<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<html>
  <head>
    <title>添加新纪录</title>
     <link href="style/bootstrap.css" rel="stylesheet" > 
     
  </head>
  
  <body>
    <%@ include file="top.jsp" %>
    <form class="form-horizontal" method="post" action="caozuo.html?task=insert">
<fieldset class="control-group">
<legend>请输入您要添加的销售记录</legend>
	<div class="control-group">
		<label class="control-label" for="focusedInput" >时间</label>
		<div class="controls">
			<input id="focusedInput" name="time" class="input-xlarge focused" type="text" style="width:400px;height:30px"  value="">
		</div>
	</div>
	<div class="control-group">
		<label class="control-label" for="focusedInput">旅行社</label>
		<div class="controls">
			<input id="focusedInput" name="travel" class="input-xlarge focused" type="text" style="width:400px;height:30px" value="">
		</div>
	</div>
	<div class="control-group" >
		<label class="control-label" onblur="isnew()" id="daoyou" for="focusedInput">导游</label>
		<div class="controls">
			<input id="focusedInput" name="guide" class="input-xlarge focused" type="text" style="width:400px;height:30px" value="">
		</div>
	</div>
	<div class="control-group" name="dianhua" style="display:none">
		<label class="control-label"  for="focusedInput">导游电话</label>
		<div class="controls">
			<input id="focusedInput" name="guideNum" class="input-xlarge focused" type="text" style="width:400px;height:30px" value="">
		</div>
	</div>
	<div class="control-group">
		<label class="control-label" for="focusedInput">客源地</label>
		<div class="controls">
			<input id="focusedInput" name="address" class="input-xlarge focused" type="text" style="width:400px;height:30px" value="">
		</div>
	</div>
	<div class="control-group">
		<label class="control-label" for="focusedInput">人数</label>
		<div class="controls">
			<input id="focusedInput" name="peopleNum" class="input-xlarge focused" type="text" style="width:400px;height:30px" value="">
		</div>
	</div>
	<div class="control-group">
		<label class="control-label" for="focusedInput">销售额</label>
		<div class="controls">
			<input id="focusedInput" name="allsell" class="input-xlarge focused" type="text" style="width:400px;height:30px" value="">
		</div>
	</div>
<div class="form-actions">
<button class="btn btn-primary" type="submit">添加</button>
<button class="btn btn-primary" type="button" onclick="quxiao()">取消</button>
</div>
</fieldset>
</form>
	<script type="text/javascript">
     	function quxiao(){
     		history.back();
     	};
     	function createXMLHttp(){
     		if(window.ActiveXObject){
     			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
     		}else{
     			xmlHttp = new XMLHttpRequest();
     		}
     	}
     	function isnew(){
     		createXMLHttp();
     		var name = getElementById("daoyou").value;
     		xmlHttp.open("POST","update.html?task=isnew",true);
     		xmlHttp.onreadystatechange = callback;
     		xmlHttp.setRequestHeader("Conten-type", "application/x-www-form-urlencoded");
     		xmlHttp.send("name="+name);
     	}
     	function callback(){
     		if(xmlHttp.readyState == 4){
     				var result = xmlHttp.responseText;
     				if(result == "is"){
     					document.getElementsByName("dianhua").style.display = "block";
     				}else{
     					document.getElementsByName("dianhua").style.display = "none";
     				}
     		}
     	}
    </script>
  </body>
  
</html>
